package org.zhou.swagger.controller;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import org.zhou.swagger.pojo.myUser;


@RestController
public class HelloController {
    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public String hello(){
    return "hello";
    }
//    只要我们的接口中返回值中存在实体类 他就会被扫描到swagger中
    @PostMapping("/myuser")
    public myUser myUser(){
        return new myUser();
    }
    //@ApiOperation()  接口 放在方法上
    @ApiOperation("hello 控制类")
    @GetMapping("/hello2")
    public String hello2(@ApiParam("用户名") String username){
        return "hello"+username;
    }


}
